home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / NXPlot3d / Source / PlotShape.m < prev    next >
Text File  |  1994-02-20  |  13KB  |  459 lines

  1. #import "Plot3DView.h"
  2. #import "PlotShape.h"
  3. #import <ri/ri.h>
  4. #import <math.h>
  5.  
  6. #define SC .05
  7. #define SCP1 SC/1.732
  8. #define SCP2 SC/.866
  9. #define SCP3 SC/2.45
  10. #define SCP4 SC/1.633-SCP3
  11.  
  12. #define SWAPP(a,b) { float f; int i; for (i=0; i<3; i++) { f=a[i]; a[i]=b[i]; b[i]=f; } }
  13.  
  14. /* used to position z axis label */
  15. struct ZAXTAB { float x,y; int d; };
  16.  
  17. @implementation PlotShape:N3DShape
  18. - renderSelf:(RtToken)context
  19. {
  20. int i,j,cm;
  21. float x,y,z,xpm,ypm;
  22. struct ZAXTAB zaxtab[8] = { {1.0,1.0,0},{-1.0,-1.0,1},{-1.0,1.0,1},{1.0,-1.0,0} ,{-1.0,-1.0,0},{1.0,1.0,1},{1.0,-1.0,1},{-1.0,1.0,0} };
  23. static RtPoint square[4]= {{-1.0,-1.0,-1.01},{1.0,-1.0,-1.01},{1.0,1.0,-1.01},{-1.0,1.0,-1.01}};
  24. static RtFloat squareST[8]= { 0.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0 };
  25. static RtPoint zsquare[4]= {{-1.0,-1.0,0},{1.0,-1.0,0},{1.0,1.0,0},{-1.0,1.0,0}};
  26. static RtPoint sq1[4]= {{-1.0,-1.0,-1.0},{-1.0,1.0,-1.0},{-1.0,1.0,1.0},{-1.0,-1.0,1.0}};
  27. static RtPoint sq2[4]= {{-1.0,1.0,-1.0},{-1.0,1.0,1.0},{1.0,1.0,1.0},{1.0,1.0,-1.0}};
  28. static RtPoint sq3[4]= {{1.0,1.0,1.0},{1.0,1.0,-1.0},{1.0,-1.0,-1.0},{1.0,-1.0,1.0}};
  29. static RtPoint sq4[4]= {{-1.0,-1.0,-1.0},{1.0,-1.0,-1.0},{1.0,-1.0,1.0},{-1.0,-1.0,1.0}};
  30. RtPoint scaX[4] = {{-1.0,-1.0,-1.0},{1.0,-1.0,-1.0},{1.0,-1.0,-1.0},{-1.0,-1.0,-1.0} };
  31. RtPoint scaY[4] = {{-1.0,-1.0,-1.0},{-1.0,1.0,-1.0},{-1.0,1.0,-1.0},{-1.0,-1.0,-1.0} };
  32. static RtPoint scaZ[4];
  33. RtFloat scaST[8] = { 0,1.0,1.0,1.0,1.0,0.75,0,0.75 };
  34. static RtFloat scaSTZ[8] = { 1.0,0.5,1.0,0,0,0,0,0.5 };
  35. static RtPoint Box[8] = {{-SC,-SC,-SC},{-SC,-SC,SC},{-SC,SC,SC},{-SC,SC,-SC}, {SC,-SC,-SC},{SC,-SC,SC},{SC,SC,SC},{SC,SC,-SC}};
  36. static RtInt BoxP[24] = {0,1,2,3,0,1,5,4,4,5,6,7,2,3,7,6,1,5,6,2,0,3,7,4};
  37. static RtInt BoxV[6]={4,4,4,4,4,4};
  38. static RtPoint Pyr[4] = {{0,-SCP2,-SCP4},{-SC,SCP1,-SCP4},{SC,SCP1,-SCP4}, {0,0,SCP4}};
  39. static RtInt PyrP[12] = {0,1,2,0,1,3,0,2,3,1,2,3};
  40. static RtInt PyrV[4] = {3,3,3,3};
  41. static RtColor bgCol = {1.0,1.0,1.0};
  42. static RtColor dCol = { 1.0,1.0,1.0 };
  43. static RtColor opac = { .2,.2,.2 };
  44. static RtPoint bsquare[4]= {{-100.0,-100.0,-40.0},{100.0,-100.0,-40.0},{100.0,100.0,-40.0},{-100.0,100.0,-40.0}};
  45. RtFloat *SZ;
  46. char tmaps[100],*tmap;
  47. char home[60];
  48.  
  49. sprintf(home,"/tmp/%s",getenv("USER"));
  50. if (getenv("USER")==NULL) strcpy(home,"/tmp"); 
  51. sprintf(tmaps,"%s/plot3d.tx",home);
  52. tmap=tmaps;
  53.  
  54. RiDeclare("texname","uniform string");
  55. RiDeclare("Cst","uniform float");
  56. RiDeclare("Csp","uniform float");
  57.  
  58. RiSurface("constant",RI_NULL);
  59. if (mode>=4) {
  60.     RiTransformBegin();
  61.     RiRotate(chi,0,0,1.0);
  62.     RiRotate(-theta+90.0,1.0,0,0);
  63.     RiColor(bgCol);
  64.     RiPolygon(4,RI_P,(RtPointer)bsquare,RI_NULL);
  65.     RiTransformEnd();
  66. }
  67.  
  68. RiSurface("matte",RI_NULL);
  69. RiColor(flagcol[1]);
  70. /* FLOOR */
  71. if (flags&2) {
  72.     if (mode>=4 && Omode&OVER_base) {
  73.     /*    RiTextureCoordinates(0,0,.5,0,0,.5,.5,.5);*/
  74.         RiSurface("texmap",(RtToken)"texname",(RtPointer)&tmap,RI_NULL);
  75.     }
  76.     RiPolygon(4,RI_P,(RtPointer)square,RI_ST,(RtPointer)squareST,RI_NULL);
  77. }
  78. RiSurface("matte",RI_NULL);
  79. RiColor(dCol);
  80.  
  81.  
  82. if (chi>90.0&&chi<270.0) ypm=-1.0;
  83. else ypm=1.0;
  84. if (chi<180.0) xpm=-1.0;
  85. else xpm=1.0;
  86.  
  87. /* Backs */
  88. if (flags&4) {
  89.     RiColor(flagcol[2]);
  90.     if (chi>90.0&&chi<270.0) RiPolygon(4,RI_P,(RtPointer)sq4,RI_NULL); 
  91.     else RiPolygon(4,RI_P,(RtPointer)sq2,RI_NULL);
  92.     if (chi<180.0) RiPolygon(4,RI_P,(RtPointer)sq1,RI_NULL);
  93.     else RiPolygon(4,RI_P,(RtPointer)sq3,RI_NULL);
  94.     if (flags&8) {
  95.         RiColor(flagcol[3]);
  96.         RiTransformBegin();
  97.         RiTranslate(xpm,0.0,0.0);
  98.         RiRotate(90.0,1.0,0.0,0.0);
  99.         RiTranslate(0,tickmin[2],0.0);
  100.         for (z=tickmin[2]; z<1.0; z+=tickstp[2]) {
  101.             RiCylinder(.007,-1.0,1.0,360.0,RI_NULL);
  102.             RiTranslate(0,tickstp[2],0);
  103.         }
  104.         RiTransformEnd();
  105.         RiTransformBegin();
  106.         RiTranslate(0.0,ypm,0.0);
  107.         RiRotate(90.0,0.0,1.0,0.0);
  108.         RiTranslate(-tickmin[2],0,0);
  109.         for (z=tickmin[2]; z<1.0; z+=tickstp[2]) {
  110.             RiCylinder(.007,-1.0,1.0,360.0,RI_NULL);
  111.             RiTranslate(-tickstp[2],0,0);
  112.         }
  113.         RiTransformEnd();
  114.     }
  115. }
  116. /* Axes */
  117. if (flags&1 && data[0].sym!=6) {
  118.     RiColor(flagcol[0]);
  119.     RiTransformBegin();
  120.     RiTranslate(-1.0,-1.0,-1.0);
  121.     RiCylinder(.015,0.0,2.0,360.0,RI_NULL);
  122.     RiTransformEnd();
  123.     RiTransformBegin();
  124.     RiRotate(-90.0,0,1.0,0.0);
  125.     RiTranslate(-1.0,-1.0,-1.0);
  126.     RiCylinder(.015,0.0,2.0,360.0,RI_NULL);
  127.     RiTransformEnd();
  128.     RiTransformBegin();
  129.     RiRotate(90.0,1.0,0.0,0.0);
  130.     RiTranslate(-1.0,-1.0,-1.0);
  131.     RiCylinder(.015,0.0,2.0,360.0,RI_NULL);
  132.     RiTransformEnd();
  133. }
  134. else if (flags&1) {
  135.     RiColor(flagcol[0]);
  136.     RiTransformBegin();
  137.     RiCylinder(.015,-1.0,1.0,360.0,RI_NULL);
  138.     RiTransformEnd();
  139.     RiTransformBegin();
  140.     RiRotate(-90.0,0,1.0,0.0);
  141.     RiCylinder(.015,-1.0,1.0,360.0,RI_NULL);
  142.     RiTransformEnd();
  143.     RiTransformBegin();
  144.     RiRotate(90.0,1.0,0.0,0.0);
  145.     RiCylinder(.015,-1.0,1.0,360.0,RI_NULL);
  146.     RiTransformEnd();
  147. }
  148.  
  149. /*else if (flags&1) {
  150.     RiColor(flagcol[0]);
  151.     RiLine(2,RI_P,axes1,RI_NULL);
  152.     RiLine(2,RI_P,axes2,RI_NULL);
  153.     RiLine(2,RI_P,axes3,RI_NULL);
  154. }*/
  155. /* Ticks */
  156. if (flags&8) {
  157.     RiColor(flagcol[0]);
  158.     RiTransformBegin();
  159.     RiRotate(-90.0,0,1.0,0.0);
  160.     RiTranslate(-1.0,-ypm,-1.0);
  161.     RiCylinder(.015,0.0,2.0,360.0,RI_NULL);
  162.     RiTransformEnd();
  163.     RiTransformBegin();
  164.     RiRotate(90.0,1.0,0.0,0.0);
  165.     RiTranslate(-xpm,-1.0,-1.0);
  166.     RiCylinder(.015,0.0,2.0,360.0,RI_NULL);
  167.     RiTransformEnd();
  168.  
  169.     RiColor(flagcol[3]);
  170.     RiTransformBegin();
  171.     RiTranslate(0,-ypm,-1.0);
  172.     RiRotate(90,0,1.0,0);
  173.     for (x=tickmin[0]; x<1.0; x+=tickstp[0]) RiDisk(x,.03,360.0,RI_NULL);
  174.     RiTransformEnd();
  175.     RiTransformBegin();
  176.     RiTranslate(-xpm,0.0,-1.0);
  177.     RiRotate(90,1.0,0,0);
  178.     for (x=tickmin[1]; x<1.0; x+=tickstp[1]) RiDisk(x,.03,360.0,RI_NULL);
  179.     RiTransformEnd();
  180.     if (!(flags&4)) {
  181.         RiTranslate(-1.0,-1.0,0.0);
  182.         for (x=tickmin[2]; x<1.0; x+=tickstp[2]) 
  183.             RiDisk(x,.03,360.0,RI_NULL);
  184.         RiTranslate(1.0,1.0,0.0);
  185.     }
  186. }
  187. /* Labels */
  188. if (flags&32 && mode>=4) {
  189.     if (ypm<0) { SWAPP(scaX[0],scaX[1]); SWAPP(scaX[2],scaX[3]); }
  190.     if (xpm>0) { SWAPP(scaY[0],scaY[1]); SWAPP(scaY[2],scaY[3]); }
  191.     scaX[0][1]=scaX[1][1]=scaX[2][1]=scaX[3][1]=-ypm;
  192.     scaY[0][0]=scaY[1][0]=scaY[2][0]=scaY[3][0]=-xpm;
  193.     scaX[0][2]-=.5/aspect;
  194.     scaX[1][2]-=.5/aspect;
  195.     scaY[0][2]-=.5/aspect;
  196.     scaY[1][2]-=.5/aspect;
  197.     i=floor(chi/45.0);
  198.     scaZ[0][2]=scaZ[1][2]=-1.0;
  199.     scaZ[2][2]=scaZ[3][2]=1.0;
  200.     scaZ[0][0]=scaZ[3][0]=zaxtab[i].x;
  201.     scaZ[1][0]=scaZ[2][0]=zaxtab[i].x;
  202.     scaZ[0][1]=scaZ[3][1]=zaxtab[i].y;
  203.     scaZ[1][1]=scaZ[2][1]=zaxtab[i].y;
  204.     if (i%2==0) {
  205.         scaZ[1][zaxtab[i].d]*=(1.0+aspect);
  206.         scaZ[2][zaxtab[i].d]*=(1.0+aspect);
  207.     }
  208.     else {
  209.         scaZ[0][zaxtab[i].d]*=(1.0+aspect);
  210.         scaZ[3][zaxtab[i].d]*=(1.0+aspect);
  211.     }
  212.     sprintf(tmaps,"%s/plot3dxyz.tx",home);
  213.     
  214.     x=1.05/ambient; y=0.0;
  215.     RiSurface("texmap",(RtToken)"texname",(RtPointer)&tmap,RI_KA,(RtPointer)&x,RI_KD,(RtPointer)&y,RI_NULL);
  216.     RiPolygon(4,RI_P,(RtPointer)scaX,RI_ST,(RtPointer)scaST,RI_NULL);
  217.  
  218.     scaST[1]=scaST[3]=.75;
  219.     scaST[5]=scaST[7]=.5;
  220.     RiPolygon(4,RI_P,(RtPointer)scaY,RI_ST,(RtPointer)scaST,RI_NULL);
  221.  
  222.     RiPolygon(4,RI_P,(RtPointer)scaZ,RI_ST,(RtPointer)scaSTZ,RI_NULL);
  223.  
  224.     sprintf(tmaps,"%s/plot3d.tx",home);
  225.     RiSurface("matte",RI_NULL);
  226. }
  227. /* Planes */
  228. if (flags&16) {
  229.     RiColor(flagcol[4]);
  230.     RiOpacity(opac);
  231.     RiTransformBegin();
  232.     RiTranslate(0,0,tickmin[2]);
  233.     for (z=tickmin[2]; z<1.0; z+=tickstp[2]) {
  234.         RiPolygon(4,RI_P,(RtPointer)zsquare,RI_NULL);
  235.         RiTranslate(0,0,tickstp[2]);
  236.     }
  237.     RiTransformEnd();
  238.     RiOpacity(dCol);
  239. }
  240.  
  241. if (data==NULL) return self;
  242. for (i=0; i<MAXSETS; i++) {
  243.     if (data[i].sym<0) continue;
  244.     if ((mode&3)>=2) RiColor(data[i].mapcol[0]);
  245.     else RiColor(data[i].mapcol[0]);
  246.  
  247.     cm=data[i].mapmode;
  248.     switch(data[i].sym) {
  249.     case 0:
  250.         for (j=0; j<data[i].ndata; j++) {
  251.             x=data[i].data[j].x;
  252.             y=data[i].data[j].y;
  253.             z=data[i].data[j].z;
  254.             if (cm) RiColor(data[i].color[j]);
  255.             RiTransformBegin();
  256.             RiTranslate(x,y,z);
  257.             RiPointsPolygons(6,BoxV,BoxP,RI_P,(RtPointer)Box,RI_NULL);
  258.             RiTransformEnd();             
  259.           }
  260.         break;
  261.     case 1:
  262.         for (j=0; j<data[i].ndata; j++) {
  263.             x=data[i].data[j].x;
  264.             y=data[i].data[j].y;
  265.             z=data[i].data[j].z;
  266.             if (cm) RiColor(data[i].color[j]);
  267.             RiTransformBegin();
  268.             RiTranslate(x,y,z);
  269.             RiPointsPolygons(4,PyrV,PyrP,RI_P,(RtPointer)Pyr,RI_NULL);
  270.             RiTransformEnd();             
  271.           }
  272.         break;
  273.     case 2:
  274.         for (j=0; j<data[i].ndata; j++) {
  275.             x=data[i].data[j].x;
  276.             y=data[i].data[j].y;
  277.             z=data[i].data[j].z;
  278.             if (cm) RiColor(data[i].color[j]);
  279.             RiTransformBegin();
  280.             RiTranslate(x,y,z);
  281.             RiSphere(SC,-SC,SC,360.0,RI_NULL);
  282.             RiTransformEnd();             
  283.           }
  284.         break;
  285.     case 3:
  286.         for (j=0; j<data[i].ndata; j++) {
  287.             x=data[i].data[j].x;
  288.             y=data[i].data[j].y;
  289.             z=data[i].data[j].z;
  290.             if (cm) RiColor(data[i].color[j]);
  291.             RiTransformBegin();
  292.             RiTranslate(x,y,z);
  293.             RiTorus(SC,SC/3.0,0,360.0,360.0,RI_NULL);
  294.             RiTransformEnd();             
  295.           }
  296.         break;
  297.     case 4:
  298.         for (j=0; j<data[i].ndata; j++) {
  299.             x=data[i].data[j].x;
  300.             y=data[i].data[j].y;
  301.             z=data[i].data[j].z;
  302.             if (cm) RiColor(data[i].color[j]);
  303.             RiTransformBegin();
  304.             RiTranslate(x,y,z);
  305.             RiCylinder(SC,-SC,SC,360.0,RI_NULL);
  306.             RiTransformEnd();             
  307.           }
  308.         break;
  309.         
  310.     case 5:
  311.         /* if (data[i].fileData!=NULL) break;    /* no mesh in file mode */
  312.         if (data[i].nx*data[i].ny!=data[i].ndata) break;
  313.         if (mode>=4 && Omode&OVER_csurf) { 
  314.             SZ=malloc(data[i].ndata*sizeof(RtFloat));
  315.             for (j=0; j<data[i].ndata; j++) SZ[j]=(data[i].data[j].z+1.0)/2.0;
  316.             RiSurface("contour",(RtToken)"Cst",(RtPointer)&Cst, (RtToken)"Csp",(RtPointer)&Csp,RI_NULL);
  317.             if (cm) 
  318.                 RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  319.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].data,
  320.                 RI_S,(RtPointer)SZ,RI_CS,(RtPointer)data[i].color,RI_NULL);
  321.             else 
  322.                 RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  323.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].data,
  324.                 RI_S,(RtPointer)SZ,RI_NULL);
  325.             free(SZ);
  326.         }
  327.         else if (mode>=4 && Omode&OVER_surf) {
  328.             RiSurface("texmap",(RtToken)"texname",(RtPointer)&tmap,RI_NULL);
  329.             RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  330.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].data,RI_NULL);
  331.         }
  332.         else if (cm)
  333.             RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC, 
  334.             data[i].ny,RI_NONPERIODIC,RI_P,(RtPointer)data[i].data,RI_CS,
  335.             (RtPointer)data[i].color,RI_NULL);
  336.         else RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  337.             RI_NONPERIODIC,RI_P,(RtPointer)data[i].data,RI_NULL);
  338.         break;
  339.     case 6:
  340.         if (data[i].nx*data[i].ny!=data[i].ndata) break;
  341.         if (mode>=4 && Omode&OVER_csurf) { 
  342.             SZ=malloc(data[i].ndata*sizeof(RtFloat));
  343.             for (j=0; j<data[i].ndata; j++) SZ[j]=(data[i].data[j].z+1.0)/2.0;
  344.             RiSurface("contour",(RtToken)"Cst",(RtPointer)&Cst, (RtToken)"Csp",(RtPointer)&Csp,RI_NULL);
  345.             if (cm) 
  346.                 RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  347.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].Sdata,
  348.                 RI_S,(RtPointer)SZ,RI_CS,(RtPointer)data[i].color,RI_NULL);
  349.             else 
  350.                 RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  351.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].Sdata,
  352.                 RI_S,(RtPointer)SZ,RI_NULL);
  353.             free(SZ);
  354.         }
  355.         else if (mode>=4 && Omode&OVER_surf) {
  356.             RiSurface("texmap",(RtToken)"texname",(RtPointer)&tmap,RI_NULL);
  357.             RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  358.                 RI_NONPERIODIC,RI_P,(RtPointer)data[i].Sdata,RI_NULL);
  359.         }
  360.         else if (cm)
  361.             RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC, 
  362.             data[i].ny,RI_NONPERIODIC,RI_P,(RtPointer)data[i].Sdata,RI_CS,
  363.             (RtPointer)data[i].color,RI_NULL);
  364.         else RiPatchMesh(RI_BILINEAR,data[i].nx,RI_NONPERIODIC,data[i].ny,
  365.             RI_NONPERIODIC,RI_P,(RtPointer)data[i].Sdata,RI_NULL);
  366.         break;
  367.     }
  368. }
  369. return self;
  370. }
  371.  
  372. -setTicks:(RtPoint)Min :(RtPoint)Step
  373. {
  374. tickmin[0]=Min[0];
  375. tickmin[1]=Min[1];
  376. tickmin[2]=Min[2];
  377. tickstp[0]=Step[0];
  378. tickstp[1]=Step[1];
  379. tickstp[2]=Step[2];
  380. return self;
  381. }
  382.  
  383. -setData:(SetPref *)Data :(int)Mode :(int)Flags
  384. {
  385.  
  386. data=Data;
  387. mode=Mode;
  388. flags=Flags;
  389. /*
  390. mmx[0]=mmy[0]=mmz[0]=MAXFLOAT;
  391. mmx[1]=mmy[1]=mmz[1]=-MAXFLOAT;
  392.  
  393. for (i=0; i<MAXSETS; i++) {
  394.     for (j=0; j<data[i].ndata; j++) {
  395.         if (data[i].data[j].x<mmx[0]) mmx[0]=data[i].data[j].x;
  396.         if (data[i].data[j].x>mmx[1]) mmx[1]=data[i].data[j].x;
  397.         if (data[i].data[j].y<mmy[0]) mmy[0]=data[i].data[j].y;
  398.         if (data[i].data[j].y>mmy[1]) mmy[1]=data[i].data[j].y;
  399.         if (data[i].data[j].z<mmz[0]) mmz[0]=data[i].data[j].z;
  400.         if (data[i].data[j].z>mmz[1]) mmz[1]=data[i].data[j].z;
  401.     }
  402. }
  403. mmx[1]=(mmx[1]-mmx[0])/2.0;
  404. mmy[1]=(mmy[1]-mmy[0])/2.0;
  405. mmz[1]=(mmz[1]-mmz[0])/2.0;
  406. */
  407. return self;
  408. }
  409.  
  410. -setFlagColors:(RtColor *)col
  411. {
  412. bcopy(col,flagcol,sizeof(RtColor)*5);
  413. return self;
  414. }
  415.  
  416. - setSurfaceType:(N3DSurfaceType)st andDescendants:(BOOL)flag
  417. {
  418. [super setSurfaceType:st andDescendants:flag];
  419. return self;
  420. }
  421.  
  422. -setAng:(float)alt :(float)az :(float)Aspect :(float)Ambient
  423. {
  424. RtPoint ax;
  425. RtMatrix mx = { { -1.0,0,0,0 }, {0,1.0,0,0}, {0,0,1.0,0}, {0,0,0,1.0} };
  426.  
  427. theta=alt*180.0/M_PI;
  428. chi=az*180.0/M_PI;
  429. aspect=Aspect;
  430. ambient=Ambient;
  431.  
  432. [self setTransformMatrix:mx];
  433.  
  434. [self scale:1.0 :1.0 :Aspect];
  435.  
  436. ax[0]=ax[1]=0; ax[2]=1.0;
  437. [self rotateAngle:chi axis:ax];
  438.  
  439. ax[0]=1.0; ax[1]=ax[2]=0;
  440. [self rotateAngle:theta-90.0 axis:ax];
  441.  
  442. return self;
  443. }
  444.  
  445. - setOver:(int)OMODE
  446. {
  447. Omode=OMODE;
  448. return self;
  449. }
  450.  
  451. -setContour:(float)start :(float)space
  452. {
  453. Cst=start;
  454. Csp=space;
  455. return self;
  456. }
  457. @end
  458.   
  459.